//#include "Ball.h"
//
//
//CBall::CBall(void)
//{
//	this->Position_ = new D3DXVECTOR3(100,100,0);
//	float vx = (  ((rand() % 80)+20) * (rand()%2==0?1:-1)  ) / 100.0;
//	float vy = (  ((rand() % 80)+20) * (rand()%2==0?1:-1)  ) / 100.0;
//	this->Velocity_ = new D3DXVECTOR3(vx,vy,0);
//	
//	this->Ball_ = new CSprite(L"abc.png",1,5,5);
//	this->Sound_ = new CSound(L"coin.wav");
//	this->BackGround_ = new CSprite(L"background.png",1,1,1);
//}
//
//
//CBall::~CBall(void)
//{
//}
//
//void CBall::Update(int deltaTime,Direction direction)
//{
//	transformVelocity(direction);
//	if(direction == LEFT || direction == RIGHT)
//		this->Position_->x += this->Velocity_->x * deltaTime;
//	if(direction == UP || direction == DOWN)
//		this->Position_->y += this->Velocity_->y * deltaTime;
//
//}
//
//void CBall::Render()
//{
//	this->BackGround_->Render(0,-1,D3DXVECTOR3(0,200,0));
//	this->Ball_->Render(0,-1,*this->Position_);
//}
//
//void CBall::transformVelocity(Direction direction)
//{
//	if(direction == LEFT)
//		this->Velocity_->x = this->Velocity_->x > 0 ? -this->Velocity_->x : this->Velocity_->x;
//	else
//		if(direction == RIGHT)
//			this->Velocity_->x = this->Velocity_->x > 0 ? this->Velocity_->x : -this->Velocity_->x;
//		else
//			if(direction == UP)
//				this->Velocity_->y = this->Velocity_->y > 0 ? -this->Velocity_->y : this->Velocity_->y;
//				if(direction == DOWN)
//					this->Velocity_->y = this->Velocity_->y > 0 ? this->Velocity_->y : -this->Velocity_->y;
//}